WPS Office.apk(点击下载) / ChargerDelegate.java


package cn.wps.moffice.foreigntemplate.charge;

import android.app.Activity;
import cn.wps.moffice.common.google.pay.sdk.Purchase;
import cn.wps.moffice.foreigntemplate.bean.ChargeConfigBean;
import cn.wps.moffice.pay.PaySource;
import cn.wps.moffice_eng.R;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import defpackage.iah;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class ChargerDelegate implements iag {
    ibg fyK;
    fba fyL;
    Activity mActivity;

    public static class a extends fcv<Void, Void, List<ChargeConfigBean>> {
        private List<ChargeConfigBean> aLN() {
            try {
                return (ArrayList) new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create().fromJson(lwd.f("https://movip.wps.com/template/v1/index/purchase_items", null), new TypeToken<ArrayList<ChargeConfigBean>>() {
                    /* class cn.wps.moffice.foreigntemplate.charge.ChargerDelegate.a.AnonymousClass1 */
                }.getType());
            } catch (IOException e) {
                e.printStackTrace();
                return null;
            }
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object[]] */
        /* access modifiers changed from: protected */
        @Override // defpackage.fcv
        public final /* synthetic */ List<ChargeConfigBean> doInBackground(Void[] voidArr) {
            return aLN();
        }
    }

    public ChargerDelegate(ibg ibg, Activity activity) {
        this.fyK = ibg;
        this.mActivity = activity;
    }

    @Override // defpackage.iag
    public final void a(final iah iah, final ial ial, final iam iam, final PaySource paySource) {
        new a() {
            /* class cn.wps.moffice.foreigntemplate.charge.ChargerDelegate.AnonymousClass1 */

            /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
            /* access modifiers changed from: protected */
            @Override // defpackage.fcv
            public final /* synthetic */ void onPostExecute(List<ChargeConfigBean> list) {
                List<ChargeConfigBean> list2 = list;
                super.onPostExecute(list2);
                if (ChargerDelegate.this.fyK != null) {
                    ChargerDelegate.this.fyK.setWaitScreen(false);
                }
                if (list2 == null || list2.size() == 0) {
                    lvg.d(ChargerDelegate.this.mActivity, R.string.public_noserver, 0);
                    return;
                }
                ChargerDelegate.this.fyL = new fba(ChargerDelegate.this.mActivity, list2, paySource, new dmr() {
                    /* class cn.wps.moffice.foreigntemplate.charge.ChargerDelegate.AnonymousClass1.AnonymousClass1 */

                    @Override // defpackage.dmr
                    public final void a(dmk dmk, Purchase purchase) {
                        if (dmk.isSuccess()) {
                            new iah.c(ChargerDelegate.this.fyK) {
                                /* class cn.wps.moffice.foreigntemplate.charge.ChargerDelegate.AnonymousClass1.AnonymousClass1.AnonymousClass1 */

                                /* access modifiers changed from: protected */
                                @Override // defpackage.iah.c
                                public final void onPostExecute(Integer num) {
                                    super.onPostExecute(num);
                                    if (num.intValue() > ial.jbM.jbY) {
                                        iah.a(ial, iam, null, false);
                                    }
                                }
                            }.execute(new Void[0]);
                        }
                    }
                });
                fba fba = ChargerDelegate.this.fyL;
                fba.dFH.a(fba);
            }
        }.execute(new Void[0]);
    }
}